 |
|
 |
Subject: NotifyIcon for the Windows Taskbar and user interaction |
 |
 |
 |
Product Area: Notes Client |
 |
Technical Area: User Interface |
 |
Platform: Windows |
 |
Release: 8.5.1 |
 |
Reproducible: Not applicable |
 |
 |
 |
 |
Hello,
i want to set my own NotifyIcon like the notes "new mail on server/domain"-Icon in the Taskbar.
I found a way over the "Shell_NotifyIcon" function. But how can i get a response from the user interaction?
Or known someone a better way?
The Script:
Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uID As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
szTip As String * 128
dwState As Long
dwStateMask As Long
szInfo As String * 256
uTimeoutAndVersion As Long
szInfoTitle As String * 64
dwInfoFlags As Long
uTimeout As Long
guidItem As GUID
End Type
Dim TIcon As NOTIFYICONDATA
Dim hwnd As Long
Const vbNull = 0&
Const NIM_ADD = &H0
Const NIM_MODIFY = &H1
Const NIM_DELETE = &H2
Const NIF_MESSAGE = &H1
Const NIF_ICON = &H2
Const NIF_TIP = &H4
Const NIF_STATE = &H8
Const NIF_INFO = &H10
Const NIF_NOICON = 0
Const NIF_INFOICON = 1
Const NIF_WARNINGICON = 2
Const NIF_ERRORICON = 3
Declare Function GetActiveWindow Lib "user32" () As Long
Declare Function Shell_NotifyIcon Lib "shell32" _
Alias "Shell_NotifyIconA" ( _
Byval dwMessage As Long, _
pnid As NOTIFYICONDATA) As Boolean
Declare Function CallWindowProc Lib "user32" Alias _
"CallWindowProcA" (Byval lpPrevWndFunc As Long, Byval _
hWnd As Long, Byval Msg As Long, Byval wParam As Long, _
Byval lParam As Long) As Long
Sub Initialize
TIcon.cbSize = Len(TIcon)
hwnd = GetActiveWindow
TIcon.hwnd = hwnd
TIcon.uId = 1&
TIcon.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
TIcon.ucallbackMessage = WM_MOUSEMOVE
TIcon.hIcon = 5
TIcon.szTip = "Mail" & Chr$(0)
Call Shell_NotifyIcon(NIM_ADD, TIcon)
End Sub
Sub Terminate
Shell_NotifyIcon NIM_DELETE, TIcon
End Sub
Function WindowProc(Byval hwnd As Long, Byval uMsg As Long, Byval wParam As Long, Byval lParam As Long) As Long
Print "WindowProc ("& hwnd &","& uMsg &","& wParam &","& lParam &")"
Call DefWindowProc(hwnd, uMsg, wParam, lParam)
End Function
 
Feedback number WEBB83VMLF created by ~Fred Desponeteroni on 03/25/2010

Status: Open
Comments:

|
|  |
|